import { Button } from 'antd';
import type React from 'react';
import type { MapMode } from '@/components/MapView/Mapless';
import styles from '../../index.module.less';
import type { TestControlProps } from '../types';

const Index: React.FC<TestControlProps> = ({ maplessRef }) => {
  const handleXD = (d: string) => {
    maplessRef.current?.toggleMode(d as MapMode);
  };

  return (
    <div className={styles.test}>
      <Button onClick={() => handleXD('2d')}>2D</Button>
      <Button onClick={() => handleXD('3d')}>3D</Button>
    </div>
  );
};

export default Index;
